import $ from '../common';
Page({
  data: {
    titleHeight: $.gData().titleHeight,
    statuHeight: $.gData().statuHeight,
    info: {},
    page: 1,
    tip: '下来加载更多'
  },
  getinfo() {
    const {
      page
    } = this.data
    $.get('/user/feedback/list', {
      page,
      limit: 20
    }, res => {
      console.log(res);
      if (res.feedbacks.length < 20) {
        this.data.tip = '已经到底了'
      } else {
        this.data.tip = '下拉加载更多'
      }
      this.setData({
        tip: this.data.tip,
        info: res
      })
    })
  },
  magnifyimg(e) {
    const {
      img: src,
      list
    } = e.currentTarget.dataset
    wx.previewImage({
      current: src, // 当前显示图片的http链接
      urls: list // 需要预览的图片http链接列表
    })
  },
  onLoad(e) {
    this.getinfo()
  },
  onShow() {}
})